#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<vector>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,a,b) for(register int i = (a);i <= (b);++i)
#define per(i,a,b) for(register int i = (a);i >= (b);--i)  
typedef long long ll;
typedef unsigned long long ull;
using std::string;using std::cin;using std::cout;

const int N = 3e5+5;
int _,n,k,l,d[N],safe[N],pos,now;
bool down = true,flag = true;

int main(){
	std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//freopen("in.in", "r", stdin);
	cin >> _;
	while(_--){
		cin >> n >> k >> l;
		pos = 0 , flag = true;
		rep(i,1,n) cin >> d[i];
		rep(i,1,n) if(d[i] + k <= l) safe[++pos] = i;
		d[0] = d[n+1] = -1e9; 
		safe[0] = 0 , safe[pos+1] = n+1;
		rep(i,1,pos+1){
			down = true , now = k;
			rep(j,safe[i-1]+1,safe[i]-1){
				now += down ? -1 : 1;
				if(down) now -= std::max(0,d[j]+now-l);
				if(now < 0 || now + d[j] > l) flag = false;
				if(now == 0) down = false;
				if(!flag) break;
			}
			if(!flag) break;
		}
		if(flag) cout << "Yes\n";
		else cout << "No\n";
	}
	return 0;
}